package com.yootk.cloud.rest;

import com.yootk.dto.DeptDTO;
import com.yootk.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class DeptRest {
    @Autowired
    private IDeptService deptService ;

    @PostMapping("/dept/add")
    public Object add(@RequestBody DeptDTO dto) {
        return this.deptService.add(dto) ;
    }

    @GetMapping("/dept/get/{deptno}")
    public Object get(@PathVariable("deptno") long deptno) {
        return this.deptService.get(deptno) ;
    }

    @GetMapping("/dept/list")
    public Object list() {
        return this.deptService.list() ;
    }
}
